/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { UploadApiResult } from '../sys/upload';
import { UploadFileParams } from '/#/axios';

const { ctxPath, adminPath } = useGlobSetting();

export interface CoreCltbjl extends BasicModel<CoreCltbjl> {
  createByName?: string; // 创建人
  updateByName?: string; // 修改人
  cltbjlCph?: string; // 车牌号
  cltbjlClsbdm?: string; // 车辆识别代码
  cltbjlFdjhm?: string; // 发动机号码
  cltbjlGcjg?: number; // 购车价格
  cltbjlZws?: number; // 座位数
  cltbjlTbgs?: string; // 投保公司
  cltbjlTbrq?: string; // 投保日期
  cltbjlBxdq?: string; // 保险到期
  cltbjlBdh?: string; // 保单号
  cltbjlSyxbf?: number; // 商业险保费
  cltbjlJqxbf?: number; // 交强险保费
  cltbjlCcsbf?: number; // 车船税保费
  cltbjlBfze?: number; // 保费总额
  coreCltbjlbtList?: any[]; // 子表列表
}

export const coreCltbjlList = (params?: CoreCltbjl | any) =>
  defHttp.get<CoreCltbjl>({ url: adminPath + '/cardd/tbjl/coreCltbjl/list', params });

export const coreCltbjlListData = (params?: CoreCltbjl | any) =>
  defHttp.post<Page<CoreCltbjl>>({ url: adminPath + '/cardd/tbjl/coreCltbjl/listData', params });

export const coreCltbjlForm = (params?: CoreCltbjl | any) =>
  defHttp.get<CoreCltbjl>({ url: adminPath + '/cardd/tbjl/coreCltbjl/form', params });

export const coreCltbjlSave = (params?: any, data?: CoreCltbjl | any) =>
  defHttp.postJson<CoreCltbjl>({ url: adminPath + '/cardd/tbjl/coreCltbjl/save', params, data });

export const coreCltbjlImportData = (
  params: UploadFileParams,
  onUploadProgress: (progressEvent: ProgressEvent) => void,
) =>
  defHttp.uploadFile<UploadApiResult>(
    {
      url: ctxPath + adminPath + '/cardd/tbjl/coreCltbjl/importData',
      onUploadProgress,
    },
    params,
  );

export const coreCltbjlDelete = (params?: CoreCltbjl | any) =>
  defHttp.get<CoreCltbjl>({ url: adminPath + '/cardd/tbjl/coreCltbjl/delete', params });
